package j_Inst;

import mips.Decoder;
import mips.PC;

public class J {
	public static void j(int targetedAddress){
		System.out.println("PC value now is : " +Decoder.toBinary(PC.pc)); 
		System.out.println("PC value :"+ Decoder.toBinary(PC.pc)+" sent to The Instruction memory to read address..");
		System.out.println("Instuction memory sending Instruction [31:26] to CONTROL,Instruction[31:26] having : "+ "000010");
		System.out.println("Instuction memory sending Instruction[25:0] to Shift left by 2");
		int shiftedAddress = targetedAddress << 2;
		PC.pc = shiftedAddress;
		System.out.println("CONTROL sends Jump of 01 to mux");
		System.out.println("mux choose the Pc value of the jump ");
        System.out.println("The new PC value : " + Decoder.toBinary(PC.pc));
        System.out.println("------------------------------------");
	}
}